package com.badu.fx.service;

import java.util.List;
import java.util.Map;

import com.badu.app.domain.AppUser;
import com.badu.fx.domain.FxLevelRecord;
import com.baomidou.mybatisplus.service.IService;

/**
 * <p>
 * 分销级别关联表 服务类
 * </p>
 *
 * @author astupidcoder123
 * @since 2021-01-13
 */
public interface IFxLevelRecordService extends IService<FxLevelRecord> {


	/**
	 * 分销级别关联
	 * @param parantOpenId
	 * @param childOpenId
	 * @return
	 */
	int addFxLevelRecord(String parantOpenId,String childOpenId);
	
	/**
	 * 查询上级
	 * @param myOpenId
	 * @return
	 */
	List<AppUser> querySuperior(String myOpenId,Integer level);
	
	/**
	 * 查询下级
	 * @param myOpenId
	 * @return
	 */
	List<AppUser> queryLowerLevel(String myOpenId,Integer level);
	
	/**
	 * 查询上级分组
	 * @param myOpenId
	 * @return
	 */
	List<Map.Entry<String,  List<AppUser>>> querySuperiorGroup(String myOpenId,Integer level);
	
	/**
	 * 查询下级
	 * @param myOpenId
	 * @return
	 */
	List<Map.Entry<String,  List<AppUser>>> queryLowerLevelGroup(String myOpenId,Integer level);
	
}
